package top.fyxxxx.dbdesign.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class SysUtil {
    //获取时间
    public static String getTime(long time){
        SimpleDateFormat formatter=new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
        formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
        Date curDate=new Date(time);//获取当前时间
        return formatter.format(curDate);
    }
    public static String getDate(long time){
        SimpleDateFormat formatter=new SimpleDateFormat ("MM.dd");
        formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
        Date curDate=new Date(time);//获取当前时间
        return formatter.format(curDate);
    }
    //检查是否有null
    public static boolean hasNull(String... strs){
        for(String s:strs)if(s==null)return true;
        return false;
    }
}
